1. Field of the Invention
The present invention relates to an image processing apparatus and an image processing method, and more particularly relates to an image processing apparatus and an image processing method for correcting a redeye region included in an image captured by an image capturing apparatus.
The present invention further relates to an image capturing apparatus that has the function of correcting a redeye region in a captured image.
2. Description of the Related Art
Conventionally, digital cameras have been known which capture optical images of subjects with the use of a photoelectric transducer and record the captured images as digital data on a recording medium typified by a memory card.
Furthermore, in a case in which a person is shot by flash photography (shot using a flash), a redeye effect is also known in which the person's eyes are photographed as red eyes. The redeye effect is caused by sensed blood vessels of retina, and likely to be caused particular in a case in which flash photography is carried out with pupils dilated in a dark place or the like.
In order to reduce the incidence of such redeye effect, image capturing apparatuses are known which have a redeye reduction function of using a lamp, a flash, or the like once immediately before flash photography (pre-emission) to constrict pupils and then carrying out flash photography. However, in a case in which a subject fails to gaze at a camera during pre-emission, the image capturing apparatuses have a problem in that the redeye reduction function is minimally effective.
While the redeye effect is caused in a similar way no matter which camera is used, a digital camera or a film camera, image processing can be easily applied to captured images in the case of a digital camera. Therefore, redeye correction techniques have been proposed in which a redeye region is automatically or semi-automatically modified in a case in which it is determined that redeye effect is caused in a detected face or detected eyes of a person included in the captured images. Japanese Patent Laid-Open No. 10-0233929 discloses detecting, as a face region, a region considered to have a flash color in a captured image and detecting a redeye region in the detected face region. Furthermore, Japanese Patent Laid-Open No. 2001-309225 discloses, for a camera which has a redeye correction function, using an algorithm for comparison between a detected geometric face model and face probability in combination with pattern matching to detect a face region in a captured image.
In the conventional art described above, a region as a candidate for a redeye region (a candidate redeye region) is detected with the degree of redness of a pixel as an evaluation value, and further, a final redeye region is specified from the size, shape, and the like of the candidate redeye region to correct the pixels in the redeye region. Therefore, computing the degree of redness of the pixels accurately is a critical factor which determines proper correction of red eyes (in other words, prevention of false corrections of regions other than the redeye region).
For example, pupil portions in which redeye effect is caused often have dark colors such as black or brown. Therefore, particular in a case in which only a small amount of flash light enters pupils, the color saturation and luminance of a redeye region will be decreased.
In order to detect such a redeye region, for example, it is conceivable to use an evaluation value E computed by the use of the following formula (1).E=(2*R−G−B)/(2Y)  (1)
In the formula, R, G, and B respectively represent the values for red, green, and blue components of a pixel, and Y represents a luminance value.
This evaluation value E is obtained by normalizing the average value ((R−G)+(R−B))/2 of color-difference signals R-G and R-B with the use of a luminance signal Y. Since this evaluation value E increases as the luminance value decreases, it is believed that the evaluation value E is effective for detection of redeye regions with their color saturation and luminance low.
However, in a case in which such an evaluation value E is used, the evaluation value for a region other than a redeye region, for example, a flesh region, is large in generally dark images such as underexposed images or images shot with no flash light reaching a subject. Therefore, such a case has a problem that a redeye region is likely to be falsely recognized, resulting in increase in the incidence of false correction.
The present invention has been made in consideration of these problems of the conventional art, and has as its object to achieve improvement in the correction factor of and prevention of false corrections of a redeye region with low color saturation and low luminance.